package com.bst.bsj.bops.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.bst.bsj.base.controller.WebBaseController;

@Scope("prototype")
@Controller
@RequestMapping(value = "/bops/test")
public class TestController extends WebBaseController {

	@RequestMapping(value = "/data")
	public ModelAndView data(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		ModelAndView modelAndView = getBopsModelAndView("data");
		return modelAndView;
	}

	@RequestMapping(value = "/company")
	public ModelAndView company(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		Map<String, Object> params = getBopsParams(req);
		String menu = (String) params.get("menu");
		ModelAndView modelAndView = getBopsModelAndView("company/" + menu);
		return modelAndView;
	}

	@RequestMapping(value = "/area")
	public ModelAndView area(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		Map<String, Object> params = getBopsParams(req);
		String menu = (String) params.get("menu");
		ModelAndView modelAndView = getBopsModelAndView("area/" + menu);
		return modelAndView;
	}

	@RequestMapping(value = "/goods")
	public ModelAndView goods(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		Map<String, Object> params = getBopsParams(req);
		String menu = (String) params.get("menu");
		ModelAndView modelAndView = getBopsModelAndView("goods/" + menu);
		return modelAndView;
	}

	@RequestMapping(value = "/management")
	public ModelAndView management(HttpServletRequest req,
			HttpServletResponse resp) throws Exception {
		Map<String, Object> params = getBopsParams(req);
		String menu = (String) params.get("menu");
		ModelAndView modelAndView = getBopsModelAndView("management/" + menu);
		return modelAndView;
	}

	@RequestMapping(value = "/privilege")
	public ModelAndView privilege(HttpServletRequest req,
			HttpServletResponse resp) throws Exception {
		Map<String, Object> params = getBopsParams(req);
		String menu = (String) params.get("menu");
		ModelAndView modelAndView = getBopsModelAndView("privilege/" + menu);
		return modelAndView;
	}
}
